<template>
  <div class="app-container">
    <!--工具栏-->
    <div class="head-container">

      <div>
        <!-- 搜索 -->
        <el-input v-model="query.xm" clearable size="small" placeholder="输入姓名" style="width: 170px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
        <el-input v-model="query.sfz" clearable size="small" placeholder="输入身份证" style="width: 170px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
        <rrOperation :crud="crud" />
      </div>
      <!--表格渲染-->
      <el-table ref="table" v-loading="crud.loading" :data="crud.data" size="small" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
        <el-table-column type="selection" width="55" />
        <el-table-column align="center" prop="psnName" label="姓名" width="130" />
        <el-table-column align="center" prop="psnCertno" label="身份证号" width="160" />
        <el-table-column align="center" prop="insutypeName" label="险种名称" />
        <el-table-column align="center" prop="empName" label="地址" width="150" />
        <el-table-column align="center" prop="insuAdmdvs" label="所属统筹区">
          <template slot-scope="scope">
            {{ dict.label.ccstcqh[scope.row.insuAdmdvs] }}
          </template>
        </el-table-column>
        <el-table-column align="center" prop="pausTypeName" label="封存类型" />
        <el-table-column align="center" prop="chgReaDscr" label="封存原因" />
        <el-table-column align="center" prop="begndate" label="开始时间" />
        <el-table-column align="center" prop="enddate" label="解封时间" width="150" />
      </el-table>
      <!--分页组件-->
      <pagination />
    </div>
  </div>
</template>

<script>
import crudZhsq from '@/api/business/zhsq'
import crudFile from '@/api/tools/localStorage'
import CRUD, { presenter, header, form } from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import pagination from '@crud/Pagination'
import { mapGetters } from 'vuex'

const defaultForm = { psnNo: null, psnName: null, psnCertno: null, aac001: null, insutype: null, insutypeName: null, empName: null, insuAdmdvs: null, pausType: null, pausTypeName: null, begndate: null, enddate: null }
export default {
  name: 'Fcxx',
  components: { pagination, rrOperation },
  mixins: [presenter(), header(),
    form(function() {
      return Object.assign({ hljg: { bisHljgId: this.bisHljgId }}, defaultForm)
    })],
  dicts: ['xb', 'yjsgx', 'ccs', 'zhzt', 'ccstcqh', 'sqlb'],
  cruds() {
    return CRUD({ title: '封存信息', url: 'api/generalQuery/queryKc08', query: { bisHljgId: '' }, idField: 'bisZhsqId', sort: 'enddate,desc', crudMethod: { ...crudZhsq }})
  },
  data() {
    return {
      dialogCancleFormVisible: false,
      dialogBhFormVisible: false,
      dialogThFormVisible: false,
      permission: {
        add: ['admin', 'zhsq:add'],
        edit: ['admin', 'zhsq:edit'],
        del: ['admin', 'zhsq:del']
      }
    }
  },
  computed: {
    ...mapGetters([
      'user'
    ])
  },
  methods: {
    // 钩子：在获取表格数据之前执行，false 则代表不获取数据
    [CRUD.HOOK.beforeRefresh]() {
      return true
    }
  }
}
</script>

<style scoped>
</style>
